package org.Image.management.SpringDataService.Service.Sys_User.Pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
// 登录请求体
public class  LoginRequest {
    @NotBlank(message = "密码或密码错误")
    @Size(min = 2, max = 20, message = "用户名长度需在2-20字符之间")
    private String name;

    @Pattern(regexp = "^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$",
            message = "密码或密码错误")
    @Size(min = 8, max = 20, message = "密码长度需在8-20字符之间")
    private String password;
}